<?php
	if(!isset($id))
	{
		$set_kota		= set_value("nama_kota");
		$set_ruas1		= set_value("ruas1");
		$set_ruas2		= set_value("ruas2");
		$set_ruas3		= set_value("ruas3");
		$set_nama_r		= set_value("nama_ruas");
		$set_panjang	= set_value("panjang");
		$set_hotmix_b	= set_value("hotmix_baik");
		$set_hotmix_s	= set_value("hotmix_sedang");
		$set_hotmix_rr	= set_value("hotmix_rr");
		$set_hotmix_rb	= set_value("hotmix_rb");
		$set_lapen_b	= set_value("lapen_baik");
		$set_lapen_s	= set_value("lapen_sedang");
		$set_lapen_rr	= set_value("lapen_rr");
		$set_lapen_rb	= set_value("lapen_rb");
		$set_lpc		= set_value("lpc");
		$set_tanah		= set_value("tanah");
		$set_hutan		= set_value("hutan");
		$set_pulau		= set_value("pulau");
		$set_rci		= set_value("rci");
		$set_iri		= set_value("iri");
	}
	else
	{
		$set_kota		= (set_value("nama_kota") == "")?($data_rj["NAMA_KOTA"]) : (set_value("nama_kota"));
		$set_ruas1		= (set_value("ruas1") == "")?($data_rj["NO_RUAS1"]) : (set_value("ruas1"));
		$set_ruas2		= (set_value("ruas2") == "")?($data_rj["NO_RUAS2"]) : (set_value("ruas2"));
		$set_ruas3		= (set_value("ruas3") == "")?($data_rj["NO_RUAS3"]) : (set_value("ruas3"));
		$set_nama_r		= (set_value("nama_ruas") == "")?($data_rj["NAMA_RUAS"]) : (set_value("nama_ruas"));
		$set_panjang	= (set_value("panjang") == "")?($data_rj["PANJANG"]) : (set_value("panjang"));
		$set_hotmix_b	= (set_value("hotmix_baik") == "")?($data_rj["HOTMIX_BAIK"]) : (set_value("hotmix_baik"));
		$set_hotmix_s	= (set_value("hotmix_sedang") == "")?($data_rj["HOTMIX_SEDANG"]) : (set_value("hotmix_sedang"));
		$set_hotmix_rr	= (set_value("hotmix_rr") == "")?($data_rj["HOTMIX_RR"]) : (set_value("hotmix_rr"));
		$set_hotmix_rb	= (set_value("hotmix_rb") == "")?($data_rj["HOTMIX_RB"]) : (set_value("hotmix_rb"));
		$set_lapen_b	= (set_value("lapen_baik") == "")?($data_rj["LAPEN_BAIK"]) : (set_value("lapen_baik"));
		$set_lapen_s	= (set_value("lapen_sedang") == "")?($data_rj["LAPEN_SEDANG"]) : (set_value("lapen_sedang"));
		$set_lapen_rr	= (set_value("lapen_rr") == "")?($data_rj["LAPEN_RR"]) : (set_value("lapen_rr"));
		$set_lapen_rb	= (set_value("lapen_rb") == "")?($data_rj["LAPEN_RB"]) : (set_value("lapen_rb"));
		$set_lpc		= (set_value("lpc") == "")?($data_rj["LPC"]) : (set_value("lpc"));
		$set_tanah		= (set_value("tanah") == "")?($data_rj["TANAH"]) : (set_value("tanah"));
		$set_hutan		= (set_value("hutan") == "")?($data_rj["HUTAN"]) : (set_value("hutan"));
		$set_pulau		= (set_value("pulau") == "")?($data_rj["PULAU"]) : (set_value("pulau"));
		$set_rci		= (set_value("rci") == "")?($data_rj["RCI"]) : (set_value("rci"));
		$set_iri		= (set_value("iri") == "")?($data_rj["IRI"]) : (set_value("iri"));
	}
?>
<style>
label{
	text-align:right;
}
</style>
<div class="row">
	<div class="col-lg-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h4>
					<span>Form Tabel Ruas Jalan</span>
				</h4>
			</div>
			<div class="panel-body">
				<?php echo form_open($post_action);?>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">Nama Kota</label>
						<div class="col-lg-8">
							<input type="text" name="nama_kota" id="nama_kota" class="form-control elastic" value="<?php echo $set_kota;?>">
						</div>
						<font color="red"><?php echo form_error("nama_kota"); ?></font>
					</div>
					<br>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">No. Ruas 1</label>
						<div class="col-lg-2">
							<input type="text" name="ruas1" id="ruas1" class="form-control elastic" value="<?php echo $set_ruas1;?>">
						</div>
						<font color="red"><?php echo form_error("ruas1"); ?></font>
						<label class="col-lg-1 control-label" for="input">No. Ruas 2</label>
						<div class="col-lg-2">
							<input type="text" name="ruas2" id="ruas2" class="form-control elastic" value="<?php echo $set_ruas2;?>">
						</div>
						<font color="red"><?php echo form_error("ruas2"); ?></font>
						<label class="col-lg-1 control-label" for="input">No. Ruas 3</label>
						<div class="col-lg-2">
							<input type="text" name="ruas3" id="ruas3" class="form-control elastic" value="<?php echo $set_ruas3;?>">
						</div>
						<font color="red"><?php echo form_error("ruas3"); ?></font>
					</div>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">Nama Ruas</label>
						<div class="col-lg-5">
							<input type="text" name="nama_ruas" id="nama_ruas" class="form-control elastic" value="<?php echo $set_nama_r;?>">
						</div>
						<font color="red"><?php echo form_error("nama_ruas"); ?></font>
						<label class="col-lg-1 control-label" for="input">Panjang</label>
						<div class="col-lg-2">
							<input type="text" name="panjang" id="panjang" class="form-control elastic" value="<?php echo $set_panjang;?>">
						</div>
						<font color="red"><?php echo form_error("panjang"); ?></font>
					</div>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input"></label>
						<div class="col-lg-7">
							<center><b>~~ Hotmix ~~<b></center>
						</div>
					</div>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">Baik</label>
						<div class="col-lg-1">
							<input type="text" name="hotmix_baik" id="hotmix_baik" class="form-control elastic" value="<?php echo $set_hotmix_b;?>">
						</div>
						<font color="red"><?php echo form_error("hotmix_baik"); ?></font>
						<label class="col-lg-1 control-label" for="input">Sedang</label>
						<div class="col-lg-1">
							<input type="text" name="hotmix_sedang" id="hotmix_sedang" class="form-control elastic" value="<?php echo $set_hotmix_s;?>">
						</div>
						<font color="red"><?php echo form_error("hotmix_sedang"); ?></font>
						<label class="col-lg-1 control-label" for="input">RR</label>
						<div class="col-lg-1">
							<input type="text" name="hotmix_rr" id="hotmix_rr" class="form-control elastic" value="<?php echo $set_hotmix_rr;?>">
						</div>
						<font color="red"><?php echo form_error("hotmix_rr"); ?></font>
						<label class="col-lg-1 control-label" for="input">RB</label>
						<div class="col-lg-2">
							<input type="text" name="hotmix_rb" id="hotmix_rb" class="form-control elastic" value="<?php echo $set_hotmix_rb;?>">
						</div>
						<font color="red"><?php echo form_error("hotmix_rb"); ?></font>
					</div>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">Lapen Baik</label>
						<div class="col-lg-1">
							<input type="text" name="lapen_baik" id="lapen_baik" class="form-control elastic" value="<?php echo $set_lapen_b;?>">
						</div>
						<font color="red"><?php echo form_error("lapen_baik"); ?></font>
						<label class="col-lg-1 control-label" for="input">Lapen Sedang</label>
						<div class="col-lg-1">
							<input type="text" name="lapen_sedang" id="lapen_sedang" class="form-control elastic" value="<?php echo $set_lapen_s;?>">
						</div>
						<font color="red"><?php echo form_error("lapen_sedang"); ?></font>
						<label class="col-lg-1 control-label" for="input">Lapen RR</label>
						<div class="col-lg-1">
							<input type="text" name="lapen_rr" id="lapen_rr" class="form-control elastic" value="<?php echo $set_lapen_rr;?>">
						</div>
						<font color="red"><?php echo form_error("lapen_rr"); ?></font>
						<label class="col-lg-1 control-label" for="input">Lapen RB</label>
						<div class="col-lg-2">
							<input type="text" name="lapen_rb" id="lapen_rb" class="form-control elastic" value="<?php echo $set_lapen_rb;?>">
						</div>
						<font color="red"><?php echo form_error("lapen_rb"); ?></font>
					</div>
					<br>
					<br>
					<br>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">LPC</label>
						<div class="col-lg-8">
							<input type="text" name="lpc" id="lpc" class="form-control elastic" value="<?php echo $set_lpc;?>">
						</div>
						<font color="red"><?php echo form_error("lpc"); ?></font>
					</div>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">Tanah</label>
						<div class="col-lg-8">
							<input type="text" name="tanah" id="tanah" class="form-control elastic" value="<?php echo $set_tanah;?>">
						</div>
						<font color="red"><?php echo form_error("tanah"); ?></font>
					</div>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">Hutan</label>
						<div class="col-lg-8">
							<input type="text" name="hutan" id="hutan" class="form-control elastic" value="<?php echo $set_hutan;?>">
						</div>
						<font color="red"><?php echo form_error("hutan"); ?></font>
					</div>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">Pulau</label>
						<div class="col-lg-8">
							<input type="text" name="pulau" id="pulau" class="form-control elastic" value="<?php echo $set_pulau;?>">
						</div>
						<font color="red"><?php echo form_error("pulau"); ?></font>
					</div>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">RCI</label>
						<div class="col-lg-8">
							<input type="text" name="rci" id="rci" class="form-control elastic" value="<?php echo $set_rci;?>">
						</div>
						<font color="red"><?php echo form_error("rci"); ?></font>
					</div>
					<br>
					<br>
					<div class="form-group">
						<label class="col-lg-2 control-label" for="input">IRI</label>
						<div class="col-lg-8">
							<input type="text" name="iri" id="iri" class="form-control elastic" value="<?php echo $set_iri;?>">
						</div>
						<font color="red"><?php echo form_error("iri"); ?></font>
					</div>
					<br>
					<br>
					<br>
					<div class="form-group">
						<div class="col-lg-offset-3 col-lg-9">
							<button type="submit" class="btn btn-info">Simpan</button>
							<button type="reset" class="btn btn-warning">Reset</button>
							<button type="button" class="btn btn-default" onClick="kembali()">Kembali</button>
						</div>
					</div>
				<?php echo form_close();?>
			</div>
		</div>
	</div>
</div>
<script>
function kembali(){
	document.location="<?php echo site_url("ruas_jalan/grid_rj");?>";
}
</script>